import request from '@/config/axios'


// AI 聊天对话 API
export const ChatConversationApi = {
  // 获得【我的】聊天对话
  getChatConversationMy: async (id) => {
    return await request.get({ url: `/ai/chat/conversation/get-my?id=${id}` })
  },

  // 新增【我的】聊天对话
  createChatConversationMy: async (data) => {
    return await request.post({ url: `/ai/chat/conversation/create-my`, data })
  },

  // 更新【我的】聊天对话
  updateChatConversationMy: async (data) => {
    return await request.put({ url: `/ai/chat/conversation/update-my`, data })
  },

  // 删除【我的】聊天对话
  deleteChatConversationMy: async (id) => {
    return await request.delete({ url: `/ai/chat/conversation/delete-my?id=${id}` })
  },

  // 删除【我的】所有对话，置顶除外
  deleteChatConversationMyByUnpinned: async (params) => {
    return await request.delete({ url: `/ai/chat/conversation/delete-by-unpinned`,params })
  },

  // 获得【我的】聊天对话列表
  getChatConversationMyList: async (params) => {
    return await request.get({ url: `/ai/chat/conversation/my-list`,params})
  },

  // 获得对话分页
  getChatConversationPage: async (params) => {
    return await request.get({ url: `/ai/chat/conversation/page`, params })
  },

  // 管理员删除消息
  deleteChatConversationByAdmin: async (id) => {
    return await request.delete({ url: `/ai/chat/conversation/delete-by-admin?id=${id}` })
  }
}
